home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 221_01 / reverse.c < prev    next >
Text File  |  1980-01-01  |  256b  |  12 lines

  1. /*
  2. **  reverse str in place
  3. */
  4. reverse(str) char *str; {
  5. int c, i, j;
  6.   for(i=0, j=strlen(str)-1; i<j; ++i, --j) {
  7.     c=str[i];
  8.     str[i]=str[j];
  9.     str[j]=c;
  10.     }
  11.   }
  12.